import request from '@/utils/request';

// 获取所有学科
export function getAllSubjects() {
  return request({
    url: '/api/subjects/all',
    method: 'get'
  });
}

// 获取学科列表
export function getSubjectList(query) {
  return request({
    url: '/api/subjects/list',
    method: 'get',
    params: query
  });
}

// 获取学科详情
export function getSubjectDetail(id) {
  return request({
    url: `/api/subjects/detail/${id}`,
    method: 'get'
  });
}

// 添加学科
export function addSubject(data) {
  return request({
    url: '/api/subjects/add',
    method: 'post',
    data
  });
}

// 更新学科
export function updateSubject(data) {
  return request({
    url: '/api/subjects/update',
    method: 'put',
    data
  });
}

// 删除学科
export function deleteSubject(id) {
  return request({
    url: `/api/subjects/delete/${id}`,
    method: 'delete'
  });
} 